package cn.tedu.proxy.service;
//目标对象
public class OrderServiceImpl implements OrderService{ //目标对象
    @Override
    public String getName() {
        System.out.println("getName()方法执行了");
        return "李四";
    }

    //以下为目标方法
    @Override
    public void generate() {
        //模拟生成订单的耗时
        try {
            Thread.sleep(123);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("订单已生成.");
    }

    @Override
    public void modify() {
        //模拟修改订单的耗时
        try {
            Thread.sleep(456);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("订单修改成功");
    }

    @Override
    public void detail() {
        //模拟查看订单的耗时
        try {
            Thread.sleep(345);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("请查看订单详情");
    }
}
